<?php
namespace app\common\component\user_wallet_freeze;

use think\Session;

class UserWalletFreezeService {
	public function create($data) {
		$userWalletFreezeModel = new UserWalletFreezeModel($data);

    	if($userWalletFreezeModel -> save()) {
    		return [
    			'code' => 0,
    			'message' => '冻结创建成功!',
    			'data' => [
    				'user_wallet_freeze' => $userWalletFreezeModel
    			]
    		];
    	}

    	return [
			'code' => -1,
			'message' => '冻结创建失败!'
		];
	}

	public function update($data, $user_wallet_freeze_id) {
		$updateUserWalletFreeze = (new UserWalletFreezeModel()) -> where('user_wallet_freeze_id', $user_wallet_freeze_id) -> update($data);

    	if($updateUserWalletFreeze) {
    		return [
    			'code' => 0,
    			'message' => '冻结修改成功'
    		];
    	}

    	return [
			'code' => -1,
			'message' => '冻结修改失败'
		];
	}
}
?>